package com.topView2;

import com.bean.TreeNode;
import com.learn.tree.TriedTree;

/**
 * @Author: huangzhigao
 * @Date: 2023/2/12 18:32
 */
public class leecode101 {
    public boolean isSymmetric(TreeNode root) {
       return isMirror(root,root);
    }

    public boolean isMirror(TreeNode head1, TreeNode head2) {
        if (head1 == null && head2 == null) {
            return false;
        }
        if (head1 == null || head2 == null) {
            return false;
        }

        return head1.val == head2.val && isMirror(head1.left,head2.right) && isMirror(head1.right,head2.left) ;
    }
}
